<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<title>日志一览</title>
<head th:replace="common/incHead :: incHead"></head>
<body class="gray-bg">
<div class="ok-body">
    <form class="layui-form layui-form-pane" lay-filter="pagerForm" id="pagerForm" action="/log/interface" method="get">
        <input type="hidden" id="pageNum" name="pageNum" value="1"/>
        <input type="hidden" id="numPerPage" name="numPerPage" th:value="${page.numPerPage}"/>
        <input type="hidden" id="orderField" name="orderField" th:value="${orderField}"/>
        <input type="hidden" id="orderDirection" name="orderDirection" th:value="${orderDirection}"/>
        <div class="layui-row pa-condition">
            <div class="layui-row">
                <div th:replace="common/plugin :: pa-input-cond('ts','开始时间','layui-col-md2',${ts})"></div>
                <div th:replace="common/plugin :: pa-input-cond('te','结束时间','layui-col-md2',${te})"></div>
                <div th:replace="common/plugin :: pa-input-cond('loggerType','日志类型','layui-col-md2',${loggerType})"></div>
                <div th:replace="common/plugin :: pa-input-cond('loggerSeesion','日志用户','layui-col-md2',${loggerSeesion})"></div>
                <div th:replace="common/plugin :: pa-input-cond('loggerLinkid','流水号信息','layui-col-md2',${loggerLinkid})"></div>
            </div>
            <div class="layui-row">
                <div th:replace="common/plugin :: pa-input-cond('loggerIp','IP信息','layui-col-md2',${loggerIp})"></div>
                <div th:replace="common/plugin :: pa-input-cond('loggerAgent','浏览器','layui-col-md2',${loggerAgent})"></div>
                <div th:replace="common/plugin :: pa-input-cond('searchValue','日志内容','layui-col-md2',${searchValue})"></div>
                <button class="layui-btn layui-btn-sm layui-btn-primary pull-right m-l-xs" title="重置数据" type="reset"><i class="layui-icon layui-icon-return"></i>重置</button>
                <button class="layui-btn layui-btn-sm layui-btn-normal pull-right btnPagerForm" title="重新检索"><i class="layui-icon layui-icon-search"></i>重新检索</button>
            </div>
        </div>
    </form>
    <div class="layui-row ljLayTableBox m-b-xl">
        <table class="layui-hide" id="indexTable" lay-filter="indexTable"></table>
    </div>
</div>
<div th:replace="common/incBottom :: incBottom"></div>
<div th:replace="common/incPage :: incPage"></div>
<!-- 初始化表格数据 -->
<script th:inline="javascript">
    /*<![CDATA[*/
    let initSort = {
        field: [[${orderField}]] || 'id',
        type: [[${orderDirection}]] || 'desc'
    };
    let indexData = [];
    /*[# th:each="item,itemStat:${records}"]*/
    indexData.push({
        id: [[${item.id}]],
        loggerType: [[${item.loggerType}]],
        loggerSeesion: [[${item.loggerSeesion}]],
        loggerLinkid: [[${item.loggerLinkid}]],
        loggerIp: [[${item.loggerIp}]],
        loggerContent: [[${item.loggerContent}]],
        createTime: [[${@lj.date(item.createTime)}]]
    });
    /*[/]*/
    /*]]>*/
</script>
<script th:inline="none">
    layui.use(["jquery", "table", "okLayer", "okPapper", "okUtils"], function () {
        let table = layui.table;
        let okPapper = layui.okPapper;
        let $ = layui.jquery;
        let okUtils = layui.okUtils;
        let config = okUtils.local("okConfig") || okConfig || {};
        okLoading.close($);
        table.render({
            elem: '#indexTable',
            height: 'full-158',
            page: false,
            data: indexData,
            limit: indexData.length,
            initSort: initSort,
            toolbar: false,
            size: config.tableSize,
            cols: [[
                {field: "id", title: "创建时间", fixed: "left", width: 150, sort: true, templet: "<div><a ljUrl='/log/interface/detail?id={{d.id}}' title='日志详情:{{d.id}}' target='ljOpenCon'>{{d.createTime}}</a></div>"},
                {field: "loggerType", title: "日志类型", fixed: "left", width: 150},
                {field: "loggerSeesion", title: "日志用户", fixed: "left", width: 150},
                {field: "loggerLinkid", title: "流水号信息", fixed: "left", width: 150},
                {field: "loggerIp", title: "IP信息", width: 150,},
                {field: "loggerContent", title: "日志内容"},
            ]],
            done: function (res, curr, count) {
            }
        });
        table.on('sort(indexTable)', function (obj) {
            $("input[name='orderField']").val(obj.field);
            $("input[name='orderDirection']").val(obj.type);
            $("#pagerForm").submit();
        });
        okPapper.init();
    })
</script>
<div th:replace="common/plugin :: pa-input-datatime('ts,te')"></div>
</body>
</html>